import request from '@/utils/request'
import { getServicePath } from '@/api/baseUrlConfig'
const servicePath = getServicePath()
// 根据顶部组织机构查询用户
export function getTreeByRole (data) {
  return request({
    url: servicePath.userServer + '/organization/getTreeByRole',
    method: 'post',
    data
  })
}

export function getList (data) {
  return request({
    url: servicePath.gzMetroMetroProjectServer + '/designProgress/getList',
    method: 'post',
    data
  })
}
export function dictDataList (data) {
  return request({
    url: servicePath.dictServer + '/dict/data/search',
    method: 'post',
    data
  })
}
export function addOrUpd (data) {
  return request({
    url: servicePath.gzMetroMetroProjectServer + '/designSetting/addOrUpdSetting',
    headers: {
      showLoading: true
    },
    method: 'post',
    data
  })
}
export function getDetailById (params) {
  return request({
    url: servicePath.gzMetroMetroProjectServer + '/project/getDetailById',
    method: 'get',
    params
  })
}
// 查询模型流程列表数据
export function getWorkFlowList (data) {
  return request({
    url: servicePath.workFlowServer + '/module/all',
    method: 'post',
    data
  })
}
// 查询机构所属的线路标段及公区
export function getOrgLineLotAndWorkArea (params) {
  return request({
    url: servicePath.userServer + '/organization/getOrgLineLotAndWorkArea',
    method: 'get',
    params
  })
}
// 根据id查询模型id
export function getModuleById (params) {
  return request({
    url: servicePath.workFlowServer + '/module/getModuleById',
    method: 'get',
    params
  })
}
// 根据id查询模型id
export function getProcessHistory (params) {
  return request({
    url: servicePath.workFlowServer + '/workflow/getProcessHistory',
    method: 'get',
    params
  })
}
export function workflowPicture (params) {
  return request({
    url: servicePath.workFlowServer + '/workflow/picture',
    method: 'get',
    responseType: 'blob',
    params
  })
}
// 查询审批内容
export function approvalContent (params) {
  return request({
    url: servicePath.gzMetroMetroProjectServer + '/designProgress/approvalContent',
    method: 'get',
    params
  })
}
// 审批
export function approval (data) {
  return request({
    url: servicePath.gzMetroMetroProjectServer + '/designProgress/approval',
    headers: {
      showLoading: true
    },
    method: 'post',
    data
  })
}
export function getUserList (data) {
  return request({
    url: servicePath.userServer + '/userInfo/getUserList',
    method: 'post',
    data
  })
}
